import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WechatMpUserVO, WechatMpUserForm, WechatMpUserQuery } from '@/api/device/wechatMpUser/types';

/**
 * 查询系统参数列表
 * @param query
 * @returns {*}
 */

export const listWechatMpUser = (query?: WechatMpUserQuery): AxiosPromise<WechatMpUserVO[]> => {
  return request({
    url: '/device/wechatMpUser/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询系统参数详细
 * @param id
 */
export const getWechatMpUser = (id: string | number): AxiosPromise<WechatMpUserVO> => {
  return request({
    url: '/device/wechatMpUser/' + id,
    method: 'get'
  });
};

/**
 * 新增系统参数
 * @param data
 */
export const addWechatMpUser = (data: WechatMpUserForm) => {
  return request({
    url: '/device/wechatMpUser',
    method: 'post',
    data: data
  });
};

/**
 * 修改系统参数
 * @param data
 */
export const updateWechatMpUser = (data: WechatMpUserForm) => {
  return request({
    url: '/device/wechatMpUser',
    method: 'put',
    data: data
  });
};

/**
 * 删除系统参数
 * @param id
 */
export const delWechatMpUser = (id: string | number | Array<string | number>) => {
  return request({
    url: '/device/wechatMpUser/' + id,
    method: 'delete'
  });
};
